// @/components/button/SubmitButton.jsx
import styles from "./SubmitButton.module.css";

const SubmitButton = ({
    text,
    disabled = false,
    type = "primary",
    loadingText = "提交中..."
}) => {
    // 根据禁用状态显示不同文本
    const displayText = disabled ? loadingText : text;

    return (
        <button
            type="submit" // 明确为提交类型，确保触发表单提交
            className={`${styles.button} ${styles[type]}`}
            disabled={disabled}
        >
            {displayText}
        </button>
    );
};

export default SubmitButton;